<#--引入layout文件-->
<#include "/ma/_layout.ftl">

<@head_meta/>
<#--定义该界面需要引入的样式-->
<@head_css>

<!-- BEGIN PAGE LEVEL STYLES -->
<link rel="stylesheet" type="text/css" href="${base}/resources/ma/css/select2_metro.css"/>
<link rel="stylesheet" href="${base}/resources/ma/css/DT_bootstrap.css"/>
<!-- END PAGE LEVEL STYLES -->
</@head_css>
<@head_script/>

<!--定义该界面需要引入的script-->
<#macro bodyscript>

<!-- BEGIN JAVASCRIPTS(Load javascripts at bottom, this will reduce page load time) -->
<!-- BEGIN CORE PLUGINS -->
<script src="${base}/resources/ma/js/jquery-migrate-1.2.1.min.js" type="text/javascript"></script>
<!-- IMPORTANT! Load jquery-ui-1.10.1.custom.min.js before bootstrap.min.js to fix bootstrap tooltip conflict with jquery ui tooltip -->
<script src="${base}/resources/ma/js/jquery-ui-1.10.1.custom.min.js" type="text/javascript"></script>
<!--[if lt IE 9]>
<script src="${base}/resources/ma/js/excanvas.min.js"></script>
<script src="${base}/resources/ma/js/respond.min.js"></script>
<![endif]-->
<script src="${base}/resources/ma/js/jquery.slimscroll.min.js" type="text/javascript"></script>
<script src="${base}/resources/ma/js/jquery.blockui.min.js" type="text/javascript"></script>
<script src="${base}/resources/ma/js/jquery.cookie.min.js" type="text/javascript"></script>
<script src="${base}/resources/ma/js/jquery.uniform.min.js" type="text/javascript"></script>
<!-- END CORE PLUGINS -->

<!-- BEGIN PAGE LEVEL PLUGINS -->

<script type="text/javascript" src="${base}/resources/ma/js/select2.min.js"></script>

<script type="text/javascript" src="${base}/resources/ma/js/jquery.dataTables.js"></script>

<script type="text/javascript" src="${base}/resources/ma/js/DT_bootstrap.js"></script>
<!-- END PAGE LEVEL PLUGINS -->
    <@tablepage colnum=9 collist=[]/>

<script type="text/javascript">
    var book = {
        del: function (id) {

            console.log("book.del " + id);
            $.ajax({
                url: '/sys/books/' + id,
                type: 'DELETE',
                dataType: 'JSON',
                success: function (result) {
                    // Do something with the result
                    console.log(result);
                    if (result.status = "OK")
//                        $('#' + id).remove();
                        console.log("更新成功，页面跳转");
                    window.location.href = '${base}/sys/books';
                }
            });
        }
    };
</script>

</#macro>
<#--定义jQuery(document).ready();方法需要初始化的函数-->
<#macro script_ready>
BookPage.init();
</#macro>

<@layout active_id="book" child_active_id="book">
<#--一定要包含于layout内-->
    <@pageheader page_title="图书管理" page_title_small="图书列表Memo" nav1_title="" nav1_url="" nav2_title="图书管理" nav2_url="" nav3_title="用户列表" nav3_url=""/>
<!-- BEGIN PAGE CONTENT-->

<div class="row-fluid">

    <div class="span12">

        <!-- BEGIN EXAMPLE TABLE PORTLET-->

        <div class="portlet box blue">

            <div class="portlet-title">

                <div class="caption"><i class="icon-globe"></i>列表</div>

                <div class="tools">

                    <a href="javascript:;" class="collapse"></a>

                    <a href="#portlet-config" data-toggle="modal" class="config"></a>

                    <a href="javascript:;" class="reload"></a>

                    <a href="javascript:;" class="remove"></a>

                </div>

            </div>

            <div class="portlet-body">

                <div class="clearfix">

                    <div class="btn-group">

                        <button id="btn_new" class="btn green"
                                onclick="javascript:window.location.href='/admin/user/add'">

                            新建 <i class="icon-plus"></i>

                        </button>

                    </div>

                    <div class="btn-group pull-right">

                        <button class="btn dropdown-toggle" data-toggle="dropdown">Tools <i class="icon-angle-down"></i>

                        </button>

                        <ul class="dropdown-menu pull-right">

                            <li><a href="#">Print</a></li>

                            <li><a href="#">Save as PDF</a></li>

                            <li><a href="#">Export to Excel</a></li>

                        </ul>

                    </div>

                </div>

                <table class="table table-striped table-bordered table-hover" id="sample_1">

                    <thead>

                    <tr>

                        <th style="width:8px;"><input type="checkbox" class="group-checkable"
                                                      data-set="#sample_1 .checkboxes"/></th>

                        <th>名称</th>
                        <th>RIFD</th>
                        <th>Barcode</th>

                        <th class="hidden-480">创建时间</th>
                        <th class="hidden-480">修改时间</th>
                        <th>状态</th>
                        <th>备注</th>
                        <th>操作</th>
                    </tr>

                    </thead>

                    <tbody>
                        <#--<#list page.content as result>-->

                        <#--<tr class="odd gradeX" id="${result.id}">-->
                            <#--<td><input type="checkbox" class="checkboxes" value="${result.id}"/></td>-->

                            <#--<td>${result.bookname}</td>-->
                            <#--<td>${result.rfid}</td>-->
                            <#--<td>${result.barcode}</td>-->

                            <#--<td class="hidden-480"><#if result.createDate??>${(result.createDate)?string("yyyy-MM-dd")}</#if></td>-->
                            <#--<td class="hidden-480"><#if result.updateDate??>${(result.updateDate)?string("yyyy-MM-dd")}</#if></td>-->
                            <#--<td><#if result.status="ON"><span class="label label-success">启用</span><#else><span-->
                                    <#--class="label label-warning">禁用</span></#if></td>-->
                            <#--<td>${result.remark}</td>-->
                            <#--<td>-->
                                <#--<!--<div class="btn-group">-->
                                     <#--<a class="btn mini purple" href="#" data-toggle="dropdown">-->
                                     <#--<i class="icon-tasks"></i> 操作-->
                                     <#--<i class="icon-angle-down"></i>-->
                                     <#--</a>-->
                                     <#--<ul class="dropdown-menu">-->
                                         <#--<li><a href="#"><i class="icon-trash"></i> Edit</a></li>-->
                                         <#--<li><a href="#"><i class="icon-remove"></i> Delete</a></li>-->
                                     <#--</ul>-->
                                 <#--</div>&ndash;&gt;-->

                                <#--<!--<span class=""><a class="edit" href="javascript:void(0);" onclick="user.edit('${result.id}');">编辑</a></span>&ndash;&gt;-->
                                <#--<span class=""><a class="edit" href="/sys/books/edit/${result.id}">编辑</a></span>-->
                                <#--<span class=""><a class="edit" href="javascript:void(0);"-->
                                                  <#--onclick="book.del('${result.id}');">删除</a></span>-->
                            <#--</td>-->
                        <#--</tr>-->
                        <#--</#list>-->
                    </tbody>

                </table>

            </div>

        </div>

        <!-- END EXAMPLE TABLE PORTLET-->

    </div>

</div>

<!-- END PAGE CONTENT-->

</div>
<!-- END PAGE CONTAINER-->

</@layout>
 